package com.li.controller;


import com.li.model.UserModel;
import com.li.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author LRC
 * @since 2021-08-03
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/cache")
    public List<UserModel> mybatisCacheTest() {
      return   userService.getList();
    }

    @RequestMapping("/add")
    public boolean add(){
        UserModel userModel=new UserModel() ;
        userModel.setName("老梁");
        return   userService.saveModel(userModel);
    }
}
